<!--文本类型-->

<template>
  <div class="message-text item-content">
    <div class="text" v-if="$slots.default">
      <slot></slot>
    </div>
    <div v-else class="text" v-html="getQQEmojiEmoji(value)"></div>
  </div>
</template>

<script>
import { getQQEmojiEmoji } from '../../../utils/qq-emoji';

export default {
  name: 'message-text',
  props: {
    value: {
      type: String,
      default: '',
    },
  },
  methods: {
    getQQEmojiEmoji(content) {
      return getQQEmojiEmoji(content);
    },
  },
};
</script>

<style lang="scss" scoped>
.message-text {
  white-space: normal;
  word-wrap: break-word;
  word-break: break-all;
  padding: 14px 23px 12px 11px;

  .text {
    line-height: 24px;
  }
}
</style>
